<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>待审核</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui/css/layui.css">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<form class="layui-form">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">企业名称：</label>
            <div class="layui-input-inline">
                <input type="text" name="orgName" id="orgName" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline" style="left:-20px;">
            <label class="layui-form-label" style="width: 140px;">统一社会信用代码：</label>
            <div class="layui-input-inline">
                <input type="text" name="creditCode" id="creditCode" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <button class="layui-btn" lay-submit lay-filter="formDemo">查询</button>
                <button class="layui-btn" lay-submit>清空</button>
            </div>
        </div>
    </div>
</form>
<table class="layui-hide" id="dataList" lay-filter="dataList"></table>
<script type="text/javascript" src="/lib/layui/layui.js"></script>
<script src="/static/js/main.js"></script>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs" lay-event="examine">审核</a>
</script>
</body>
<script>
    layui.use(['jquery', 'configureCom', 'configure', 'table', 'element','sessionFun'], function () {
        var $ = layui.jquery;
        var configure = layui.configure;
        var element = layui.element; //元素操作
        var matchDict = layui.matchDict;
        var sessionFun = layui.sessionFun;
        var table = layui.table;
        var configureCom = layui.configureCom;
        //监听搜索13833130205
        configureCom.tableSearch();
        var cols = [[
            {field: 'orgName', width: 250, title: '审核企业'},
            {field: 'creditCode', width: 180, title: '统一社会信用代码'},
            {
                field: 'orgType', width: 120, title: '注册企业类型', templet: function (d) {
                    return '<p>' + matchDict.name(d.orgType, configure.COMPANY_TYPE_CODE) + '</p>';

                }
            },
            {field: 'userName', width: 180, title: '企业账户'},
            {field: 'createTime', width: 180, title: '申请时间'},
            {field: 'comartiperson', width: 180, title: '企业法人'},
            {field: 'comartiphone', width: 180, title: '法人联系电话'},
            {title: '操作', toolbar: '#barDemo', width: 150}
        ]];
        configureCom.tableRender(configure.ORG_LIST_HTTP, {status: configure.ORG_STATUS_WAIT}, cols, 'dataList', 10, 'full-70','toolbarOrg');
        //每行操作
        table.on('tool(dataList)', function (obj) {
            var data = obj.data;
            sessionFun.set(configure.SESSION_ENTERPRISE_LIST_DATA, data);
            if (obj.event === 'examine') {//查看详情
                top.layer.open({
                    type: 2,
                    title: '注册企业信息审核',
                    area: configureCom.Psize1,
                    content: configureCom.nocache(configure.COM_DETAIL_READ_HTML),
                    btn: ['通过', '不通过'],
                    btnAlign: 'c',
                    yes: function (index, layero) {
                        top.layer.confirm('确认通过吗？', function (childIndex, childLayero) {
                            configureCom.postDataAjax(configure.ORG_SHENHE_PASS, {orgNo: data.orgNo}).then(function (res) {
                                top.layer.close(index);
                                top.layer.close(childIndex);
                                top.layer.msg('保存成功！');
                                configureCom.tableReload(true);
                            });
                        });
                    },
                    btn2: function (index, layero) {
                        top.layer.prompt({
                            formType: 2,
                            title: '请填写不通过意见',
                            value: ''
                        }, function (value, childIndex) {
                            if (!value) {
                                top.layer.msg('请填写意见！');
                                return false;
                            }
                            configureCom.postDataAjax(configure.ORG_SHENHE_NOPASS, {orgNo: data.orgNo, auditTxt: value}).then(function (res) {
                                top.layer.close(index);
                                top.layer.close(childIndex);
                                top.layer.msg('保存成功！');
                                configureCom.tableReload(true);
                            });
                            layer.close(index);
                        });
                        return false;
                    }
                });
            }
        });
    });


</script>